﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EventsTestOne
{
    class Property:IPropertyChange
    {
        private event PropertyChangedEventHandler propertyChange;

        public event PropertyChangedEventHandler PropertyChange
        {
            add
            {
                propertyChange += value;
                Console.WriteLine("add");
            }
            remove
            {
                propertyChange -= value;
                Console.WriteLine("remove");
            }
        }

        protected void OnPropertyChange(object sender, EventArgs args)
        {
            if (propertyChange != null)
            {
                propertyChange(this, EventArgs.Empty);
            }
        }
    }
}
